-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mission dialogue rmlui widget #4233
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of questions about architecture we still need to answer, particularly around file and folder structure. We should settle those questions before we start merging rmlui widgets.
I changed the folder structure a little bit. Old one was just what Chris used in his example widgets. I propose that all .rml files will be in /luaui/Widgets/rml and all .rcss files will be in /luaui/Widgets/rcss. Furthermore I propose that we will have two main rcss files: bar_ui.rcss that contains the common styles that we use in new UI and default_styles.rcss that contains fallback default styles for the basic elements when nothing else is defined for them. |
I think it would make more sense for each widget to be a folder, containing the .lua and .rml files, along with any widget-specific .rcss or resource files (images, sounds, etc.). Since the .lua and .rml files are tightly coupled, they are always worked on at the same time, so it makes sense for them to be located together. There would be shared folders for common elements, like global .rcss files, images, and sounds. |
|
||
--hide dialogue popup after a while | ||
popupTimer = popupTimer + dt | ||
if popupTimer > popupTimeout then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the first time the document is hidden won't it be spamming calls to document:Hide()
again? Even then, would be good to not even have the update callin when the dialogue is unused.
I'd suggest registering the :Update
callin once the dialog is shown, and deregistering when it's hidden. Deregistering on initialization.
See
Beyond-All-Reason/luaui/Widgets/autocheat.lua
Lines 22 to 24 in 1107e22
widgetHandler:UpdateCallIn('GameFrame'); | |
else | |
widgetHandler:RemoveCallIn('GameFrame'); |
This adds a way to call dialogue popups for missions. It's intended to be used with mission api and still needs to be integrated into that once mission api is ready for it.
Works with
WG['mission_dialogue'].SendDialogue(character_name, message, character_portrait, side, soundfile, popupTimeout)
e.g.
WG['mission_dialogue'].SendDialogue("Some Dude","Hello World!", "somedude.png", "right", "dialogue1.wav",5)